package ch.usi.inf.pf2.node;


import ch.usi.inf.pf2.cell.NumericValue;
import ch.usi.inf.pf2.cell.Value;
import ch.usi.inf.pf2.node.Constant;
import junit.framework.TestCase;
/**
 * A AdditionTest ,it tests if Addition class works or not.
 * 
 * @author Elham.menzer@gmail.com
 */

public class AdditionTest extends TestCase {

		
		public void testCompute(){
			//(10+4)+5+6
			Node n =new Addition(
					new Addition(
					new Addition(
							new Constant (10),
							new Constant (4)
							),
							new Constant(5)),
									new Constant (6));
			Value v =n.evaluate();
			assertEquals(25.0,((NumericValue)v).get());
							
		}
			

	}


